Home Super Mario Bros Games Puzzle Games Physics Games Flash Games Girls Games Marvin Games Games Walkthroughs
Java Program Tutorials

Only Best Physics Games

I've change app/code/local/Mage/Adminhtml/Block/Sales/Order/Grid.php to customize what's on the Orders grid.

In _getCollectionClass() I have this:

protected function _getCollectionClass()
{
    //return 'sales/order_grid_collection';
    return 'sales/order_collection';
}

and in _prepareCollection() I have this:

protected function _prepareCollection()
{
    $collection = Mage::getResourceModel($this->_getCollectionClass());

    $collection->getSelect()->joinLeft(array('s1' => 'sales_flat_order_address'),'main_table.shipping_address_id = s1.entity_id',array('region','firstname','lastname'));
    $collection->getSelect()->joinLeft(array('s2'=>'sales_flat_order_address'),'main_table.billing_address_id = s2.entity_id',array('firstname','lastname'));

    $collection->getSelect()->columns(new Zend_Db_Expr("CONCAT(s2.firstname, ' ',s2.lastname) AS billing_name"));
    $collection->getSelect()->columns(new Zend_Db_Expr("CONCAT(s1.firstname, ' ',s1.lastname) AS shipping_name"));

$collection->getSelect()->joinLeft(array('sfo'=>'sales_flat_order'),'sfo.entity_id=main_table.entity_id',array('sfo.customer_email','sfo.weight','sfo.discount_description','sfo.increment_id','sfo.store_id','sfo.created_at','sfo.status','sfo.base_grand_total','sfo.grand_total')); // New 
    $collection->getSelect()->joinLeft(array('sfoa'=>'sales_flat_order_address'),'main_table.entity_id = sfoa.parent_id AND sfoa.address_type="shipping"',array('sfoa.street','sfoa.city','sfoa.region','sfoa.postcode','sfoa.telephone')); // New


    $this->setCollection($collection);

    return parent::_prepareCollection();
}

Now I've changed the _prepareColumns() to add my necessary fields and all works great! Except for one thing...

When I search for orders by Billing or Shipping, I get an error. I've added filter_index's ('filter_index' => 'theindex') to all the necessary components and they all work great EXCEPT those two fields Billing or Shipping.

So I put filter_index's on those too.

Everything comes up great. I can search the other fields but as soon as I search the Billing or Shipping fields, I get this error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'billing_name' in 'where clause'

I have tried all sorts of things but nothing seems to work. Can someone please help!???



View the Original Page Here: Magento - SQLSTATE[42S22]: Column not found: 1054 Unknown column 'billing_name' in 'where clause'     Back to the List

Cheats, Walkthroughs Related to: Magento - SQLSTATE[42S22]: Column not found: 1054 Unknown column 'billing_name' in 'where clause'

Only Best Physics Games

I'm using rails 3 with devise.

I have a User table with fields: email, password, fname, lname

I currently output errors in my view as follows:

<% if @user.errors.any? %>
    <div id="error_explanation" class="error">
    <h2>Hold on!</h2>
        <ul>
            <% @user.errors.full_messages.each do |msg| %>
                <li><%= msg %></li>
            <% end %>
        </ul>
    </div>
<% end %>

Problem is this renders as:

Email The User's Email cannot be blank
Password The User's Password cannot be blank
Fname The User's Fname is too short (minimum 1 characters)
Lname The User's Lname is too short (minimum 1 characters)

How can I get the field name to not appear first with every error?

In my user model I have:

validates :fname, :length => { :minimum => 1, :maximum => 100 } validates :lname, :length => { :minimum => 1, :maximum => 100 }

I can customize those fields with a message attribute. What about email and password which appear to be built into devise? How do I customize those error messages?

Thanks

Update Date: 2012-02-21 17:20
Searched Times: 2

I am having a scenario where I need to call a java method which takes in a string parameter which is Javascript code to be executed by the method.

executeJavaScript( String javascriptCodeToBeExecuted ) {
}

Right now, here is what I am doing

String javascriptCodeToBeExecuted  = "function example(a,b) {" + 
"number += a;" +
"alert(\'You have chosen: \' + b);" +
"}" ;

Since the amount of JS code is overwhelming, I would like to keep all javascript in external files and have my java program read the content as a string.

Is there a clean way of doing this ? Perhaps a library which takes care of escape sequences, etc ?

Thanks !

Update Date: 2012-02-21 17:19
Searched Times: 3

I have a custom tableController class and i want to close the keyboard by return key.

Classic methods for UITextFields,

resignFirstResponder

does not work. How should i do it???

Update Date: 2012-02-21 17:19
Searched Times: 12

Just wanted to check if my solution looks good.

The problem is to reorder the list-of-lists of doubles:

[ [a, b, c],  [aa, bb, cc] ]

into this:

[ [a, aa],   [b, bb],  [c, cc] ]

After poking about I came up with the following (a function that increasingly diggs deeper and deeper into sublists, taking their head and joining them together):

organize xs = organize' xs head
--recursive function (type stolen from ghci)
organize':: [[a]] -> ([a] -> b) -> [b]
organize' [] f = []
organize' xs f = (map f xs)++(organize' xs (f . tail)

Can I do better or is it ok?

Update Date: 2012-02-21 17:19
Searched Times: 3

I have created a Kinect application using the Kinect SDK and the WPF in C#.

I want to create a simple static gesture recognition method that outputs a Messagebox when the user raises their 'rightHand' (JointID.HandRight) joint over their 'Head' (JointID.Head) joint at runtime.

I know that I need create a defintion for this gesture and run this against the skeletons each time the SkeletonFrameReady event is fired. Is there anyone who can help with this or point me in the right direction as to what skeleton data I need to store/compare, I would be very grateful, Thanks.

Update Date: 2012-02-21 17:18
Searched Times: 5


Only Best Physics Games


Java Program Examples
RSS4Java.com is dedicated to popular Java technology posts, blogs and entries.
Copyright© 2010 Rss4Java.com. Java is a trademark of Sun Microsystems, Inc. All blogs, posts and entries are the property of their authors.